﻿Public Class FrmInsertarBlanco

#Region "variables"
    Public habilitarVarios As Boolean = False
    Private _posX As Integer
    Private _posY As Integer
    Private _cant As Integer
    Property posicionX() As Integer
        Get
            Return _posX
        End Get
        Set(ByVal value As Integer)
            _posX = value
        End Set
    End Property
    Property posicionY() As Integer
        Get
            Return _posY
        End Get
        Set(ByVal value As Integer)
            _posY = value
        End Set
    End Property
    Property cantidad() As Integer
        Get
            Return _cant
        End Get
        Set(ByVal value As Integer)
            _cant = value
        End Set
    End Property
#End Region


    Private Sub btnCancelar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancelar.Click
        Me.txtFilaCaballoBlanco.Text = ""
        Me.txtColumnaCaballoBlanco.Text = ""
    End Sub

    Private Sub btnCancelarCantidad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancelarCantidad.Click
        Me.txtCantidadBlanco.Text = ""
    End Sub

    Private Sub btnGenerarCantidad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGenerarCantidad.Click
        Dim Random As New Random()
        Me.txtCantidadBlanco.Text = Random.Next(1, 63)
    End Sub

    Private Sub btnFila_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFila.Click
        Me.txtFilaCaballoBlanco.Text = Funciones.randomX
    End Sub

    Private Sub btnColumna_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnColumna.Click
        Me.txtColumnaCaballoBlanco.Text = Funciones.randomY
    End Sub

    Private Sub btnAceptar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAceptar.Click
        Me.posicionX = Me.txtFilaCaballoBlanco.Text

        Me.posicionY = Me.txtColumnaCaballoBlanco.Text
        Me.Close()

    End Sub

    Private Sub btnAceptarCandidad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAceptarCandidad.Click
        Me.habilitarVarios = True
        Me.cantidad = Me.txtCantidadBlanco.Text
        Me.Close()
    End Sub

    Private Sub FrmInsertarBlanco_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.txtCantidadBlanco.Text = Funciones.randomCantidadPieza
        Me.txtFilaCaballoBlanco.Text = Funciones.randomX
        Me.txtColumnaCaballoBlanco.Text = Funciones.randomY

    End Sub
End Class